package com.edu.base.common;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;

public class ParamsUtil {

	public static List<String> listAllParams(HttpServletRequest request) {
		//获取URL参数
		List<String> list = new ArrayList<>();
		String queryString = request.getQueryString();
        if(StringUtils.isNotEmpty(queryString)) {
    		String[] paramArr = queryString.split("&");
    		if(paramArr.length > 0) {
    			for(String paramStr : paramArr) {
    				String[] paramArr2 = paramStr.split("=");
    				if(paramArr2.length > 0) {
    					list.add(paramArr2[0]);
    				}
    			}
    		}
        } 
		//获取请求body 
        return list;
	}
}
